//
//  DJTableBarController.m
//  掌中会议通
//
//  Created by wanghy on 15/12/17.
//  Copyright © 2015年 wanghy. All rights reserved.
//

#import "DJTableBarController.h"
#import "DJHViewController.h"
#import "DJNavController.h"
#import "DJSecondViewController.h"
#import "DJDiscoverController.h"
#import "DJMeController.h"

@implementation DJTableBarController


-(void)viewDidLoad{

    [super viewDidLoad];
    
    DJHViewController * firstVc =  [[DJHViewController alloc]init];
    DJSecondViewController * messageVc2 = [[DJSecondViewController alloc]init];
    DJDiscoverController * discoverVc = [[DJDiscoverController alloc]init];
    DJMeController * meVc = [[DJMeController alloc]init];
    
    

    
    [self addChildControllelrWithVc:firstVc andTitle:@"会话" andImageName:@"tabbar_chats"];
    [self addChildControllelrWithVc:messageVc2 andTitle:@"群组" andImageName:@"tabbar_message_center"];
    [self addChildControllelrWithVc:discoverVc andTitle:@"发现" andImageName:@"tabbar_discover"];
     [self addChildControllelrWithVc:meVc andTitle:@"我" andImageName:@"tabbar_profile"];
}


//添加控制器
-(void)addChildControllelrWithVc:(UIViewController *)vc andTitle:(NSString *)title andImageName:(NSString*)ImageName{

    DJNavController * NavgationVc = [[DJNavController alloc]initWithRootViewController:vc];
    NavgationVc.title = title;
    NavgationVc.tabBarItem.image = [UIImage imageNamed:ImageName];
    [self addChildViewController:NavgationVc];

    
}

@end
